import { get, post } from "../utils/request";

// 判断简称是否重复
export const checkStoreAbbrName = (params) => {
  return get("/cloud-merchant/mrc/h5/checkStoreAbbrName", {
    ...params,
  });
};

// 添加门店
export const storeAdd = (data) => {
  return post("/cloud-merchant/mrc/h5/storeAdd", {
    ...data,
  });
};

// 结算周期
export const getAgentSettlementConfigList = (id) => {
  return get("/cloud-agent/agent/agentinfo/getAgentSettlementConfigList", {
    id,
  });
};

// 验证账号是否已使用
export const checkUserName = (userName, deptId) => {
  return get("/cloud-merchant/mrc/h5/checkUserName", {
    userName,
    deptId,
  });
};

// 获取商户列表
export const getMerchantList = (current, keyword) => {
  return get("/cloud-merchant/mrc/mrcinfo/getMrcByNameOrNo", {
    current,
    keyword,
    merchantStatus: 2,
    size: 20,
  });
};
// /cloud-system/register-setting/
export const getMerDetail = (params) => {
  return get("/cloud-merchant/mrc/mrcinfo/detail/?id=" + params);
};
export const getCommonConfigByTenantId = () => {
  return get("/cloud-system/common-setting/getCommonConfigByTenantId");
};
export const storeCount = (merchantId) => {
  return get("/cloud-merchant/mrc/h5/storeCount", { merchantId });
};
// 获取商户详情
export const getMerchantDetail = (id) => {
  return get("/cloud-merchant/mrc/mrcinfo/detail", {
    id,
  });
};

export const isBlacklist = (data) => {
  return get("/cloud-merchant/mrc/blacklist/isBlacklist", { idCard: data });
};

// 获取新结算周期
export const getEntryAllowedInfo = (data) => {
  return get("/cloud-agent/agent/agentinfo/getEntryAllowedInfo", {
    agentId: data,
  });
};

// 获取商户详情
export const getNewUserName = (params) => {
  return get("/cloud-merchant/mrc/h5/getNewUserName", params);
};
